/*
 *
 * Copyright(c) TODO
 * licensing@realtor.org
 * http://www.realtor.org/license
 */

AD = {};
AD.Globals = {};
AD.Format = {};
AD.Data = {};
AD.UI = {};

/* 
 * You can configure AD to use either bing or google maps or both. 
 * 
 * You can get Google Maps API key from 
 * http://code.google.com/apis/maps/signup.html 
 * 
 * If you use Bing maps and use this commercially you can get the commercial Bing API key from
 * http://msdn.microsoft.com/en-us/library/ee681900.aspx
 * 
*/
/************ONLY USE THIS AREA TO CONFIGURE THE MAPS********************************/
AD.UI.map_goog_enabled = true;  //set it to false to disable google maps..
AD.UI.map_goog_key     = "";  	//Please get the key from..  http://code.google.com/apis/maps/signup.html and enter it between the quotes...

AD.UI.map_bing_enabled = true; //set it to false to disable bing maps..
/*************NOTHING TO CONFIGURE BELOW THIS LINE      *******************************/

Ext.onReady(function()
{
	Ext.QuickTips.init();

	function get_client_width()
	{
		var width = 0;
		if (self.innerHeight)
		{
			width = self.innerWidth;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
		{
			width = document.documentElement.clientWidth;
		}
		else if (document.body)
		{
			width = document.body.clientWidth;
		}
		return width * 0.987;
	}
	function get_client_height()
	{
		var height = 0;
		if (self.innerHeight)
		{
			height = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
		{
			height = document.documentElement.clientHeight;
		}
		else if (document.body)
		{
			height = document.body.clientHeight;
		}
		return height * 0.987;
	}
	function init_Globals()
	{
		//Constants
		AD.Globals.client_height = get_client_height();
		AD.Globals.client_width = get_client_width();

		AD.Globals.form_width = AD.Globals.client_width
		AD.Globals.form_height = 550;
		AD.Globals.field_width = 200;
		AD.Globals.MAX_PROPS = 26;

		//Urls
		AD.Globals.URL_report = "index.php?cmd=report&fmt=";
		AD.Globals.URL_server = "index.php?cmd=server&sub_cmd=";
		AD.Globals.URL_session = "index.php?cmd=session&sub_cmd=";
		AD.Globals.URL_user_data = "index.php?cmd=user_data&sub_cmd=";
		
		AD.Globals.URL_AD = "index.php";
	}
	init_Globals();
	Ext.state.Manager.setProvider(new Ext.state.CookieProvider({ expires: new Date(new Date().getTime()+(1000*60*60*24*7)) }));
});
/*
 * 
 	if(true == AD.UI.map_goog_enabled)
 	
	if(true == AD.UI.map_bing_enabled)
			
 * */
